function [ outputfilter error_rate] = run_vb_pooled( alldata,testtasks,pca_dimensionality )
%RUN_VB_POOLED Summary of this function goes here
%   Detailed explanation goes here

 % train using the pooled data set
  % 0.05 is the prior variance of parameters
  [posterior,prior] = initialize_rsl({alldata}, 0.05); 
  % 500 is number of iterations
  posterior2 = optimize_rsl(posterior, prior, {alldata}, 500);  
  classprobabilities = predict_rsl(posterior2, testtasks);
  classifications = -1 + 2*(classprobabilities > 0.5);
  classaccuracy = sum(classifications == testtasks(:,end))/size(testtasks,1);


  outputfilter = posterior2{2}(1:pca_dimensionality);
  error_rate = classaccuracy;

end

